<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>删除重复卡</title>
</head>

<body>
<div style="margin-top:150px;width: 100%;text-align: center">
    <form id="removeDuplicate_form" role="form" method="post">
        <div style="margin: 10px;margin-left: 20px">
            <input class="easyui-combobox" id="pkHrorg" name="pkHrorg"
                   data-options="valueField:'pkhrorg',textField:'name',url:'/user/getUserOrgHrorg',label:'组织',labelWidth:'40',required :'required',prompt:'查询必选项'"
                   style="width: 240px;height: 30px"/>
        </div>
        <div style="margin-left: 13px">
            <label>选择时间</label>
            <input id="DuplicateTime" name="time" style="width: 200px;height: 30px">&nbsp;&nbsp;&nbsp;
        </div>
        <a href="#" id="DuplicateRemove" class="easyui-linkbutton" style="margin: 20px"
           data-options="iconCls:'icon-reload'"
           onclick="removeDuplicateDelect()">清除</a>
    </form>
</div>
<script th:inline="none" type="text/javascript">

    $(function () {
        showDate("DuplicateTime");
    });

    function removeDuplicateDelect() {
        var a = $("#pkHrorg").val();
        var b = $("#DuplicateTime").val();
        if (a != "" && b != "") {
            $.messager.confirm('确认', '您确认想要清除 ' + b + ' 的重复卡信息吗？', function (r) {
                if (r) {
                    $("#DuplicateRemove").css("color", "#CCC");
                    $('#DuplicateRemove').linkbutton('disable');
                    $("<div class=\"datagrid-mask\"></div>").css({
                        display: "block",
                        width: "100%",
                        height: "auto"
                    }).appendTo("body");
                    $("<div class=\"datagrid-mask-msg\"></div>").html("<img  class ='img1' /> 正在清除重复数据，请稍候。。。").appendTo("body").css({
                        display: "block",
                        'font-size': '12px',
                        height: "auto",
                        left: ($(document.body).outerWidth(true)) / 2,
                        top: ($(window).height() - 45) / 2
                    });
                    $.ajax({
                        type: "POST",
                        dataType: "json",
                        url: "/hr/sealflag",
                        data: $('#removeDuplicate_form').serialize(),
                        success: function (data) {
                            $(".datagrid-mask").remove();
                            $(".datagrid-mask-msg").remove();
                            $("#DuplicateRemove").linkbutton("enable");
                            $("#DuplicateRemove").css("color", "black");
                            topCommonMessage(data.msg);
                            if (data.statu==404){
                                warnSessionConfirm();
                            }
                        },
                        error: function () {
                            $(".datagrid-mask").remove();
                            $(".datagrid-mask-msg").remove();
                        }
                    })
                }
            })
        } else
            topCommonMessage("请填写好信息!（组织名称，日期是必选项！）")
    };
</script>
</body>
</html>